package com.caregiver.watch.business.data.controller;

import com.caregiver.watch.business.data.service.AlgorithmService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@Tag(name  = "SleepController", description = "睡眠服务")
@Slf4j
@RestController
@RequestMapping("/health")
public class SleepController {


    @Autowired
    private AlgorithmService algorithmService;

    @Operation(summary = "获取计算后的睡眠数据", description = "获取计算后的睡眠数据")
    @GetMapping(value = "sleep")
    public String getSleepResult(@RequestParam(name = "deviceid") String deviceid, @RequestParam(name = "sleep_date") String sleepDate) {
        return algorithmService.getSleepResult(deviceid, sleepDate);
    }


}
